/******************************************************************************
 * Copyright (C) 2025 FILEXSPACE, Inc.(Gmbh) or its affiliates.
 * 
 * All Rights Reserved.
 * 
 * @file bsp_led_driver.c
 * 
 * @par dependencies 
 * - bsp_led_driver.h
 * - stdio.h
 * - stdint.h
 * 
 * @author FANS | R&D Dept. | FILEXSPACE FILEX?????
 * 
 * @brief Provide the HAL APIs of LED and corresponding opetions.
 * 
 * Processing flow:
 * 
 * call directly.
 * 
 * @version V1.0 2025-02-27
 *
 * @note 1 tab == 4 spaces!
 * 
 *****************************************************************************/

//******************************** Includes *********************************//
#include "bsp_led_driver.h"


//******************************** Includes *********************************//

//******************************** Defines **********************************//

//******************************** Defines **********************************//

//******************************* Declaring *********************************//
/** 
* @brief instantiate the target of
* 
* Steps:
* 1,XOR each byte of the input data with the CRC register.
* 2,For each bit,check the most significant bit.
* 3,Shift the CRC register left and,if the most significant bit is 1,
* XOR with the polynomial.
*
* @param[in]p_data Pointer to the input data.
* @param[in]length Length of the input data.
* @param[in]p data Pointer to the input data.
* @param[in]p_data Pointer to the input data.
* 
* @return led_status_t : The status of running.
**/
led_status_t led_driver_inst(
                                bsp_led_driver_t * const self,  //定义一个obj
                                const led_operations_t * const led_ops,
#ifdef OS_SUPPORTING
                                const os_delay_t       * const os_delay,
#endif //OS_SUPPORTING
                                const time_base_t      * const time_base         
                                                                            )
{
    led_status_t ret;
    DEBUG_OUT("led_inst_start\r\n");

    /*Pointer is NULL*/
    if( NULL == self     ||
        NULL == led_ops  ||
#ifdef OS_SUPPORTING
        NULL == os_delay ||
#endif //OS_SUPPORTING
        NULL == time_base
                                )
    {
#ifdef DEBUG
        DEBUG_OUT("LED_ERROR_PARAMETER\r\n");
#endif  //DEBUG
        return LED_ERROR_PARAMETER;
    }

    if( INITED == self->is_inited)
    {
#ifdef DEBUG
        DEBUG_OUT("LED_ERROR_RESOURCE\r\n");
#endif  //DEBUG
        return LED_ERROR_RESOURCE;
    }

#ifdef DEBUG
    DEBUG_OUT("led_inst_start\r\n");
#endif  //DEBUG



}
//******************************* Declaring *********************************//
